package com.bms.hystrix.interfaces.jxgl;

import com.bms.hystrix.pojo.YiWuRenYuanVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author zhangyujin
 * @version 1.0
 * @description ServiceFeignByCheck.java
 * @date 2021/3/22 10:03
 */
@FeignClient(value = "LIAOTIANSHICLIENT")
public interface ServiceFeignByCheck {
    /*
    这里需要几个要点：
    1.这里定义的路径作用是调用client中的接口
    2.这里的method即是只定义了get，在feign还是会检查client是否允许post请求，如果没有post请求将报错
    3.@RequestParam(value = "name")是绑定controller中的形式参数名，如果没有value属性定义也会报错
     */
    @RequestMapping(value = "/yiWuRenYuan/chaXunById",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map selectClient(@RequestParam(value = "id") String id);

    @RequestMapping(value = "/yiWuRenYuan/chaXunFenYe",method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map chaXunFenYe(@RequestParam Integer page, @RequestParam String mingCheng);

    @RequestMapping(value = "/yiWuRenYuan/xinZeng2", method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes ="application/json")
    Map xinZeng(@RequestBody YiWuRenYuanVo yiWuRenYuan);

    @RequestMapping(value = "/yiWuRenYuan/chaxXunByTiaoJian", method = RequestMethod.GET,
            produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    Map<String, Object> chaxXunByTiaoJian(@RequestParam String name,
                                          @RequestParam Integer page,
                                          @RequestParam Integer limit);
}

